<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>修改用户密码</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resources/layui/css/layui.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/resources/layui/layui.js"></script>
</head>
<body>
<div class="layui-bg-gray" style="padding-left: 50px;">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-panel">
                <div id="div1" style="margin-left: 60px;margin-top: 50px">
                    <h2>用户密码修改</h2>
                    <form class="layui-form layui-form-pane" style="margin-top: 20px">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">密码</label>
                                <div class="layui-input-inline">
                                    <input name="oldpwd" type="text" class="layui-input" lay-verify="required">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">新密码</label>
                                <div class="layui-input-inline">
                                    <input name="newpwd" type="text" class="layui-input" lay-verify="required">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">再次输入密码</label>
                                <div class="layui-input-inline">
                                    <input name="newpwd1" type="text" class="layui-input" lay-verify="required">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <input class="layui-btn" type="button" lay-submit lay-filter="subpwd" value="提交">
                                <input class="layui-btn" type="reset"  value="重置">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    layui.use(['jquery','form','layer','upload'],function () {
        var $ = layui.jquery;
        var form = layui.form;
        var layer = layui.layer;
        var upload = layui.upload;

       form.on("submit(subpwd)",function(formdata1){
           //console.log(${user.id});
            $.post("${pageContext.request.contextPath}/su.do?service=motifyPwd&id="+${user.id},formdata1.field,function (rs) {
                if(rs.code == 200){
                    layer.msg("修改成功!");
                }
            })
       })
    })
</script>
</html>
